package com.zscat.mallplus.controller;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.zscat.mallplus.annotation.SysLog;
import com.zscat.mallplus.membervail.entity.MemberVail;
import com.zscat.mallplus.service.MemberVailService;
import com.zscat.mallplus.utils.CommonResult;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author king.wyx@qq.com
 * @date 2020-09-08
 */
@RequestMapping("/api/memberVail")
@Slf4j
@RestController
public class MemberVailController {
    @Autowired
    private MemberVailService memberVailService;

    @SysLog(MODULE = "memberVail", REMARK = "意见反馈列表列表")
    @ApiOperation("身份认证信息列表")
    @GetMapping("/list")
    public CommonResult list(@ApiParam(name ="pageSiz",value = "页数",defaultValue = "1") Integer pageSiz,
                             @ApiParam(name = "pageNum",value = "条数",defaultValue = "10") Integer pageNum) {
        IPage<MemberVail> page = memberVailService.page(
                new Page<>(pageNum, pageSiz),
                new QueryWrapper<MemberVail>()
                        .lambda()
                        .orderByDesc(MemberVail::getCreatTime)
        );
        return new CommonResult().success(page);
    }
}
